<?php
require_once '../sub/init.php';
require_once 'chkUadm.php';
if(!in_array('pay_qd',$QXARR))exit(noauth());
require_once ZEAI.'m/div_left_so.php';
function rows_ulist($rows,$p) {
	global $db;
	$id = $rows['id'];
	$kind = $rows['kind'];
	if ($kind == 5 || $kind == 6 || $kind == 11 || $kind == 12){
		$uid = $rows['tg_uid'];
		$row2 = $db->ROW(__TBL_TG_USER__,"uname,grade,nickname","id=".$uid);
		if ($row2){
			$grade     = $row2['grade'];
			$nickname = dataIO($row2['nickname'],'out');
		}
	}else{
		$uid = $rows['uid'];
		$row2 = $db->ROW(__TBL_USER__,"uname,sex,grade,nickname","id=".$uid);
		if ($row2){
			$sex       = $row2['sex'];
			$grade     = $row2['grade'];
			$nickname = dataIO($row2['nickname'],'out');
		}
	}
	$uname = strip_tags($row2['uname']);
	$uname = str_replace($Skey,"<font color=red><b>".$Skey."</b></font>",$uname);
	$nickname = dataIO($row2['nickname'],'out');
	$nickname = str_replace($Skey,"<font color=red><b>".$Skey."</b></font>",$nickname);
	$sex      = $row2['sex'];
	$grade    = $row2['grade'];
	if(empty($nickname))$nickname = $uname;
	
	$orderid = $rows['orderid'];
	$orderid = str_replace($Skey3,"<font color=red><b>".$Skey3."</b></font>",$orderid);
	$title = dataIO($rows['title'],'out');
	$title = str_replace($Skey2,"<font color=red><b>".$Skey2."</b></font>",$title);
	//$money  = $rows['money'];
	$paymoney  = $rows['paymoney'];
	$flag  = $rows['flag'];
	$kind  = $rows['kind'];
	//$trade_no  = $rows['trade_no'];
	$addtime = YmdHis($rows['addtime']);
    $bz = dataIO($rows['bz'],'out');
	if($flag == 1){
		$flag_str = '成功';
		$numstyle = "f1";
	}elseif($flag==-2){
		$flag_str = '已退款';
		$numstyle = "f-2";
	}else{
		$flag_str = '未付款';
		$numstyle = "f0";
	}
	if ($kind == 5 || $kind == 6 || $kind == 11 || $kind == 12){
		$u_str .= '<span class="middle S12 C999">';
		$u_str .= $nickname."　(id：".$uid.")";
		$u_str .= '</span>';
	}else{
		//echo '<a href="'.Href('crm_u',$uid).'">';
		$u_str .= uicon($sex.$grade);
		$u_str .=  '<span class="middle S12 C999">';
		$u_str .=  $nickname."　(uid：".$uid.")";
		$u_str .=  '</span>';
		//echo '</a>';
	}
	$u_str .= '<br>';
	
	$O = '<dl><dt>'.$u_str.'《'.$title.'》<font>'.$bz.'</font><font>'.$addtime.'</font></dt><dd class="'.$numstyle.'">￥<span>'.$paymoney.'</span><div class="ico">'.$flag_str.'</div></dd></dl>';
	return $O;
}
$nodatatips="<div class='nodatatips'><i class='ico'>&#xe608;</i>暂无信息</div>";
$_ZEAI['pagesize'] = 15;

$ZEAI_SQL = "";
$Skey  = trimhtml($Skey);
$Skey2 = trimhtml($Skey2);
$Skey3 = trimhtml($Skey3);
if (ifint($Skey))$ZEAI_SQL  = " AND (uid=$Skey OR tg_uid=$Skey) ";
if (ifint($uid))$ZEAI_SQL   = " AND uid=$uid ";
if(!empty($Skey2))$ZEAI_SQL = " AND ( title LIKE '%".$Skey2."%' )";
if(!empty($Skey3))$ZEAI_SQL = " AND ( orderid LIKE '%".$Skey3."%' )";
$pkind=intval($pkind);
if (ifint($pkind))$ZEAI_SQL    .= " AND kind=".$pkind;
if ($payflag == 'f1')$ZEAI_SQL .= " AND flag=1";
if ($payflag == 'f0')$ZEAI_SQL .= " AND flag=0";
//
$ZEAI_SELECT="SELECT * FROM ".__TBL_PAY__." WHERE kind<>-1 ".$ZEAI_SQL." ORDER BY id DESC";
if($submitok=='ZEAI_list'){exit(Zeai_ajax_list_fn($ZEAI_totalP,$p));}
$ZEAI_total = $db->COUNT(__TBL_PAY__,"kind<>-1 ".$ZEAI_SQL);
$ZEAI_totalP= ceil($ZEAI_total/$_ZEAI['pagesize']);
//
$nav='index';
?>
<!doctype html><html><head><meta charset="utf-8">
<title><?php echo $_ADM['admSiteName']; ?></title>
<?php echo HEADMETA; ?>
<script src="<?php echo RES;?>www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/m.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<link href="<?php echo RES;?>m/css/m.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<?php require_once 'm_style.php';?>
<link href="css/m_adm.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<style>
/*ZEAI_list*/
.ZEAI_list{padding:50px 0 80px;width:94%;margin:0 auto;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box}
.ZEAI_list dl{width:100%;padding:10px 15px;box-sizing:border-box;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;clear:both;overflow:auto;border-bottom:#f8f8f8 1px solid}
.ZEAI_list dl:last-child{border-bottom:0}
.ZEAI_list dl dt,.ZEAI_list dl dd{float:left;display:block}
.ZEAI_list dl:hover{background-color:#f8f8f8}
.ZEAI_list dl dt{width:70%;font-size:14px;text-align:left;line-height:150%}
.ZEAI_list dl dt font{color:#999;font-size:12px;display:block}
.ZEAI_list dl dd{width:28%;text-align:right;font-size:12px;font-family:Arial, Helvetica, sans-serif;padding:15px 0 10px}
.ZEAI_list dl dd.f1{color:#11A71C}
.ZEAI_list dl dd.f-2{color:#00f}
.ZEAI_list dl dd.f0{color:#ccc}
.ZEAI_list dl dd span{font-size:16px}
.ZEAI_list dl dd div{display:block}
.ZEAI_list .nodatatips i{font-size:120px;line-height:120px}
</style>
</head>
<body>
<?php 
$mini_title='支付清单';$mini_class='top_mini4 ';
require_once ZEAI.'m/top_mini.php';?>
<a class="so" id="user_search"><i class="ico">&#xe66c;</i><span>筛选</span></a>
<div class="ZEAI_list" id="ZEAI_list"><?php if($ZEAI_totalP>0){echo Zeai_ajax_list_fn($ZEAI_totalP,$p);}else{echo $nodatatips;}?></div>
<!--div_left_so-->
<div id="rangebox"></div>
<div class="div_left_so" id="user_so">
	<form action="m_pay.php" method="get" name="www.yzlove.com" id="ZEAI_CN_FORM_ext">
    	<div class="form_uid">
        <input name="Skey3" type="text" class="input" id="Skey3" maxlength="20" value="<?php echo $Skey3;?>" placeholder="按支付订单号" autocomplete="off">
        <button type="submit" class="ico">&#xe6c4;</button>
		</div>
    	<div class="form_uid">
        <input name="Skey" type="text" class="input" id="Skey" maxlength="20" value="<?php echo $Skey;?>" placeholder="按用户UID/推广员ID" autocomplete="off">
        <button type="submit" class="ico">&#xe6c4;</button>
		</div>
    	<div class="form_uid">
        <input name="Skey2" type="text" class="input" id="Skey2" maxlength="20" value="<?php echo $Skey2;?>" placeholder="按支付项目内容" autocomplete="off">
        <button type="submit" class="ico">&#xe6c4;</button>
		</div>
        <?php
		div_left_so_out(array('tbody'=>'支付状态','t'=>'payflag','tv'=>$payflag,'subkind'=>2,'newarr'=>json_decode('[{"i":"f0","v":"未付款"},{"i":"f1","v":"付款成功"}]'),'ulcls'=>' col3'));
		div_left_so_out(array('tbody'=>'支付项目','t'=>'pkind','tv'=>$pkind,'subkind'=>2,'newarr'=>json_decode('[
		{"i":"1","v":"VIP升级"},
		{"i":"2","v":"'.$_ZEAI['loveB'].'充值"},
		{"i":"3","v":"余额充值"},
		{"i":"4","v":"活动报名"},
		{"i":"8","v":"文章打赏"},
		{"i":"9","v":"用户注销"},
		{"i":"7","v":"用户认证"},
		{"i":"13","v":"互选相亲"},
		{"i":"19","v":"用户置顶"},
		{"i":"20","v":"付费注册"},
		{"i":"21","v":"入群费"},
		{"i":"22","v":"情感测试"},
		{"i":"5","v":"推广员升级"},
		{"i":"6","v":"推广员激活"},
		{"i":"11","v":"商家入驻"},
		{"i":"12","v":"商品购买"}]'),'ulcls'=>' col3'));
		?>
        <script>div_left_so_init('user_so')</script>
        <div class="savebox"><button type="button" class="btn size3 reset" onClick="div_left_so_reset('user_so')">重置</button><button type="submit" class="btn size3 zeaibg ico">&#xe6c4; 确定</button></div>
    </form>
</div>
<script>user_search.onclick=function(){ZeaiM.div_left({obj:user_so,w:28});}</script>
<!--div_left_so end-->
<script>
<?php
if ($ZEAI_total > $_ZEAI['pagesize']){?>
var ZEAI_totalP = parseInt(<?php echo $ZEAI_totalP; ?>),p=2;
zeaiOnscroll_json={url:'m_pay'+zeai.ajxext+'',data:{submitok:'ZEAI_list',ZEAI_totalP:ZEAI_totalP,payflag:payflag.value,pkind:pkind.value,Skey:Skey.value,Skey2:Skey2.value,Skey3:Skey3.value}};
document.body.onscroll = zeaiOnscroll;
<?php }?>
</script>
<div id="backtop"><a id="btmTopBtn"><i class="ico">&#xe60c;</i>顶部</a></div>
<?php require_once 'm_btm.php';?>